<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>俱乐部成员列表</title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<include file="public/comm" />
	</head>

	<body>
		<header class="mui-bar mui-bar-nav fs_xl">
			<a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
			<h1 class="mui-title fs_xl">俱乐部成员列表</h1>
		</header>
		<include file="public/station_nav" />
		<div class="mui-content fs_xl" style="padding-bottom: 3em;">
			<div class="apply_item1">
				<div class="apply_top1 fs_xl">
					<a class="fs_xs">昵称</a>
					<a class="fs_xs">ID及推客</a>
					<a class="fs_xs">消费金额</a>
					<a class="fs_xs">手机</a>
					<a class="fs_xs">操作</a>
				</div>
				<div class="apply_m1 fs_xl">
					<ul>
						<volist name="member_list" id="vo">
							<li>
								<a class="fs_xs">{$vo.nickname}</a>
								<a class="fs_xs">{$vo.user_id}<span class="green fs_xs">({$vo.station_distribut})</span></a><!--用户ID加其发展的站员数量-->
								<a class="fs_xs">{$vo.income_count}</a>
								
								<!--<a class="fs_xs" <if $is_captain == 1>href="tel:{$vo.mobile}"</if> >{$vo.mobile|substr_replace=###,"****",3,4}</a>-->
								<a class="fs_xs" <if $is_captain == 1>href="tel:{$vo.mobile}"</if> >****</a>
								<if $is_captain == 1>
									<if $vo.identity == 0>
										<a class="fs_xs" user_id="{$vo.user_id}"><span class="agree green consent">同意</span>|<span class="member_refuse">拒绝</span></a>
									<elseif $vo.identity == 1>
										<a class="fs_xs"><span class="agree">秘书长</span></a>
									</elseif>
									<elseif $vo.identity == 2>
										<a class="fs_xs" user_id="{$vo.user_id}"><span class="agree orange">助理</span>|<span class="assistant_refuse">取消</span></a>
									</elseif>
									<elseif $vo.identity == 3>
										<a class="fs_xs" user_id="{$vo.user_id}"><span class="agree feise promote_assistant">提升为助理</span></a>
									</elseif>
									<else />
										<a class="fs_xs"><span class="agree black">成员</span></a>
									</if>
								<else />
									<if $vo.identity == 1>
										<a class="fs_xs"><span class="agree">秘书长</span></a>
									<elseif $vo.identity == 2>
										<a class="fs_xs"><span class="agree orange">助理</span></a>
									</elseif>
									<else />
										<a class="fs_xs"><span class="agree black">成员</span></a>
									</if>
								</if>
							</li>
						</volist>
					</ul>
				</div>
			</div>
		</div>
		<script type="text/javascript">
			$(function(){
				$(".apply_m1 li span").each(function(){
					if($(this).hasClass("green")){
						$(this).parents("li").css("background","#f5f5f5")
					}
				})
				//同意入站
				$(".consent").click(function(){
					var user_id = $(this).parent().attr("user_id");
					$.ajax({
						type:"POST",
						url:"/Mobile/station/station_member_oprata",
						data:{"user_id":user_id,"type":1},
						dataType:"json",
						success:function(data){
							alert(data.msg);
							location.reload();
						}
					});
				})
				
				//拒绝入站
				$(".member_refuse").click(function(){
					var user_id = $(this).parent().attr("user_id");
					$.ajax({
						type:"POST",
						url:"/Mobile/station/station_member_oprata",
						data:{"user_id":user_id,"type":2},
						dataType:"json",
						success:function(data){
							alert(data.msg);
							location.reload();
						}
					});
				})
				
				//提升为助理
				$(".promote_assistant").click(function(){
					var user_id = $(this).parent().attr("user_id");
					$.ajax({
						type:"POST",
						url:"/Mobile/station/station_member_oprata",
						data:{"user_id":user_id,"type":3},
						dataType:"json",
						success:function(data){
							alert(data.msg);
							location.reload();
						}
					});
				})
				
				//取消助理
				$(".assistant_refuse").click(function(){
					var user_id = $(this).parent().attr("user_id");
					$.ajax({
						type:"POST",
						url:"/Mobile/station/station_member_oprata",
						data:{"user_id":user_id,"type":4},
						dataType:"json",
						success:function(data){
							alert(data.msg);
							location.reload();
						}
					});
				})
				
				
			})
		</script>
	</body>
</html>